package cn.tedu.mm.front.account.controller;

import cn.tedu.mm.common.pojo.authentication.CurrentPrincipal;
import cn.tedu.mm.common.web.JsonResult;
import cn.tedu.mm.front.account.Service.IReadHistoryService;
import cn.tedu.mm.front.account.pojo.vo.ListRaedHistorryVO;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

@RestController
@RequestMapping("/readhistories")
@Slf4j
@Api(tags = "01. 历史记录")
public class ReadHistoryController {
    @Autowired
    private IReadHistoryService readHistoryService;
    @GetMapping("")
    @ApiOperation("获取阅读历史纪录")
    @ApiOperationSupport(order = 400)
    public JsonResult listReadHistory(Long id){
        final List<ListRaedHistorryVO> list = readHistoryService.listReadHistory(id);
        return JsonResult.ok(list);
    }
}
